using System;
using System.Text;
using System.Collections.Generic;


namespace Mengsk.ProxyDelivery.Domain
{

    public class DeliveryTemplate : IComparable<DeliveryTemplate>
    {
        public virtual int Id { get; set; }

        public DeliveryTemplateType Type { get; set; }
        public virtual string Name { get; set; }
        public virtual int Warehouse { get; set; }
        public virtual float PaperMoney { get; set; }
        public virtual string DeliveryCompany { get; set; }
        public virtual string Template { get; set; }
        public virtual DateTime CreateTime { get; set; }
        public virtual DateTime UpdateTime { get; set; }
        public virtual string Operator { get; set; }
        public virtual bool Enabled { get; set; }

        public virtual bool WebShowEnabled { get; set; }

        public int Order { get; set; }

        public List<DeliveryTemplateArea> Areas { get; set; }

        public DeliveryTemplate()
        {
            this.Areas = new List<DeliveryTemplateArea>();
        }

        public int CompareTo(DeliveryTemplate other)
        {
            if (other == null)
            {
                return 1;
            }

            if (this.Type != other.Type)
            {
                return (int)this.Type - (int)other.Type;
            }

            return this.Order - other.Order;
        }
    }
}
